home *** CD-ROM | disk | FTP | other *** search
- Path: news.citenet.net!g34-84
- From: kabir@citenet.net (larry mintz)
- Newsgroups: comp.lang.c
- Subject: A little more explanation
- Date: Sat, 23 Mar 96 13:56:46 GMT
- Organization: CiteNet Telecom - Commercial Internet Service
- Message-ID: <4j1018$r6i@cti01.citenet.net>
- References: <4iskkm$guk@cti01.citenet.net> <4isl5t$guk@cti01.citenet.net>
- NNTP-Posting-Host: g34-84.citenet.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
-
- I have the following data in a file called log.dat.It represents the login/out
- times of people on a network: The fields are
- NAME LOGIN_TIME LOGOUT_TIME PORT
- with the following data:
-
- urstupid 5:12:12 67
- iamsmart 12:34:11 13:23:11 90
- kthomas 14:23:11 15:12:45 23
- urstupid 5:30:12 6:00:00 25
-
- The structure I am using is
- struct xx{ char NAME[10];
- > char LOGIN_TIME[10];
- char LOGOUT_TIME[10];
- unsigned PORT:5;
- };
- struct xx LOGTABLE[10];
-
- Question: How do I load log.dat into the struct LOGTABLE[10] so all the data
- is in the proper fields?
-
- What I want is the sructure to look like the following:
-
- logtable{{"urstupid","5:12:12","", 67},
- {"iamsmart","12:34:11","13:23:11", 90},
- {"kthomas","3:30:45", "4:00:00", 23},
- {"urstupid", "5:30:12", "6:00:00" 25}
- };
-
- I've tried to read in a structure using fread. It reads in all the data into
- each field ! Help ! What can I do?
-
- Kabir.
- >kabir.
-